
export const External_navlist = [
	{
		name: '南站直达',
		id: 1,
	},
	{
		name: '机场直达',
		id: 2,
	},
	{
		name: '福祉车',
		id: 3,
	},
	{
		name: '校园车',
		id: 4,
	},
	{
		name: '直通快线',
		id: 5,
	},
	// {
	// 	name: '企业用车',
	// 	id: 6,
	// },
	{
		name: '包车服务',
		id: 7,
	},
	{
		name: '广坲城游',
		id: 8,
	},
	{
		name: '周边游',
		id: 9,
	},
	
]

export const External_sreenlist = [
	{
		isChecked: true,
		isAll: true,
		title: '订单类型',
		children: [],
		key: 'OrderType',
	},
	{
		isChecked: true,
		isAll: false,
		title: '订单状态',
		children: [
			{
				name: '全部',
				id: 'all',
				isChecked: false,
			},
			{
				name: '待支付',
				id: 'pay',
				isChecked: false,
			},
			{
				name: '待出行',
				id: 'trip',
				isChecked: false,
			},
			{
				name: '出行中',
				id: 'progress',
				isChecked: false,
			},
			{
				name: '已完成',
				id: 'finish',
				isChecked: false,
			},
			{
				name: '已取消',
				id: 'close',
				isChecked: false,
			},
		],
		key: 'type',
	},
	{
		isTime: true,
		title: '下单时间',
		rangetime: [],
		key: 'start_time',
		isError: false,
	},
	// {
	// 	isTime: true,
	// 	title: '出行时间',
	// 	rangetime: [],
	// 	key: 'TravelTime',
	// 	isError: false,
	// },
]

export const External_detail1 = [
	{
		title: '订单编号',
		value: '',
		key: 'sn',
	},
	{
		title: '预定模式',
		value: '',
		key: 'car_model',
		isparent: 'car_snap',
		isRegular: true,
		regularArr: ['拼车', '包车'],
	},
	{
		title: '乘车人数',
		value: '',
		key: 'car_sharing_num',
		isparent: 'car_snap',
	},
	{
		title: '联系电话',
		value: '',
		key: 'contact_phone',
	},
	{
		title: '订单金额',
		value: '',
		key: 'original_order_amount',
		isMoney: true,
	},
	{
		title: '优惠金额',
		value: '',
		key: 'discount_amount',
		isMoney: true,
	},
	{
		title: '实付金额',
		value: '',
		key: 'order_amount',
		isMoney: true,
	},
	{
		title: '支付方式',
		value: '',
		key: 'pay_way',
		isRegular: true,
		regularArr: ['余额支付','微信支付','支付宝支付'],
	},
	{
		title: '支付时间',
		value: '',
		key: 'pay_time',
	},
]

export const External_detail2 = [
	{
		title: '套餐名称',
		value: '',
		key: 'title',
		isparent: 'ctta_snap',
	},
	{
		title: '联系电话',
		value: '',
		key: 'contact_phone',
	},
	{
		title: '订单编号',
		value: '',
		key: 'sn',
	},
	{
		title: '订单金额',
		value: '',
		key: 'original_order_amount',
		isMoney: true,
	},
	{
		title: '优惠金额',
		value: '',
		key: 'discount_amount',
		isMoney: true,
	},
	{
		title: '支付方式',
		value: '',
		key: 'pay_way',
		isRegular: true,
		regularArr: ['余额支付','微信支付','支付宝支付'],
	},
	{
		title: '支付时间',
		value: '',
		key: 'pay_time',
	},
]

export function setFounds(arr, res){
	for(let item of arr) {
		let {key, isparent, isRegular} = item
		if(isparent) {
			let cval = res[isparent] ? res[isparent][key] : ''
			if(isRegular){
				let list = item.regularArr || []
				item.value = cval ? list[cval - 1] : ''
			}
			else {
				item.value = cval
			}
		}
		else if(isRegular){
			let list = item.regularArr || []
			let val = res[key]
			item.value = val ? list[val - 1] : ''
		}
		else if(item.isMoney) {
			item.value = '￥' + res[key] || ''
		}
		else {
			item.value = res[key] || ''
		}
	}
	return arr
}

export const External_soinvolist = [
	{
		isTime: true,
		title: '订单日期',
		rangetime: [],
		key: 'OrderTime',
		isError: false,
	},
	{
		isRange: true,
		title: '可开票金额范围（元）',
		minVal: '',
		maxVal: '',
		key: 'order_amount',
		isError: false,
	},
	{
		title: '订单类型',
		children: [
			{
				name: '南站直达',
				id: 1,
			},
			{
				name: '机场直达',
				id: 2,
			},
			{
				name: '福祉车',
				id: 3,
			},
			{
				name: '校园车',
				id: 4,
			},
			{
				name: '直通快线',
				id: 5,
			},
			{
				name: '包车服务',
				id: 7,
			},
			{
				name: '广坲城游',
				id: 8,
			},
			{
				name: '周边游',
				id: 9,
			},
		],
		key: 'order_type_shop',
	},	
]